import { controlShowPage } from "../../utils/utils"

const { default: request } = require("../../plugins/request")
const { valIsNull } = require("../../utils/utils")
import store from "../../utils/store"

const pageOptions = {
	// 页面数据
	data: {
		incorrectExampleList: [
			//错误示范列表
			{
				title: "头部歪斜",
				description: "确保水平对准屏幕，避免镜头晃动",
				image:
					"https://xwx.gzzmedu.com/pic/informationVerification/2ca901faf874.png",
			},
			{
				title: "服装撞色",
				description: "确保水平对准屏幕，避免镜头晃动",
				image:
					"https://xwx.gzzmedu.com/pic/informationVerification/6f2528a864ad.png",
			},
			{
				title: "背景复杂",
				description: "请站在纯色背景墙前，避免背景复杂",
				image:
					"https://xwx.gzzmedu.com/pic/informationVerification/9eee1cf48677.png",
			},
			{
				title: "光源不足",
				description: "注意光线均匀充足，不逆光",
				image:
					"https://xwx.gzzmedu.com/pic/informationVerification/4f5dc468a5c1.png",
			},
		],
		showPage: false, // 是否显示页面，用于微信审核
	},
	// 页面准备好时
	onReady() {},
	// 页面显示时
	async onShow() {
		this.setData({
			showPage: await controlShowPage(),
		})
	},
	// 页面隐藏时
	onHide() {},
	// 页面卸载时
	onUnload() {},
	// 下拉页面时
	onPullDownRefresh() {},
	// 到达页面底部时
	onReachBottom() {},
	// 页面滚动时
	onPageScroll() {},
	// 分享时，注：onShareAppMessage不能为async异步函数，会导致不能及时取得返回值，使得分享设置无效
	onShareAppMessage() {
		/* const title = ''
    const path = ''
    const imageUrl = ``

    return {
      title,
      path,
      imageUrl,
    } */
	},
	//开始验证
	handleStartCheck() {
		if (this.data.agreement === false) {
			wx.showToast({
				title: "请先勾选协议",
				icon: "none",
			})
			return
		}
		wx.redirectTo({
			url: "/informationVerification/pages/shootPortrait/index",
		})
	},
}

Page(pageOptions)
